from langgraph_sdk import get_client
import asyncio

client = get_client(url="http://127.0.0.1:2024")


async def main():
    async for chunk in client.runs.stream(
        None,       # Thread less run
        "agent",    # Name of assistant. Defined in langgraph.json.
        input={
            "messages": [{
                "role": "human",
                # "content": "绍兴今天的天气怎么样？"
                "content": "给当前用户生成依据祝福语"
            }]
        },
        config={'configurable': {'user_name': 'Algernoon'}}
    ):
        print(f"Receiving new event of type: {chunk.event}...")
        print(chunk.data)
        print("\n\n")


if __name__ == '__main__':
    asyncio.run(main=main())
